﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace FX.CC.Andon.Kanban
{
    public partial class frmErrorTips : Form
    {
        public string ErrorMsg { get; set; }
        Action<Form> act = new Action<Form>((frm) => { frm.Hide(); });
        public frmErrorTips()
        {
            InitializeComponent();
        }

        void WaitAndHide(object obj) {
            Thread.Sleep(5000);
            this.BeginInvoke(act, this);
        }

        private void frmErrorTips_Activated(object sender, EventArgs e)
        {
            txtError.Text = ErrorMsg;
            ThreadPool.QueueUserWorkItem(WaitAndHide, null);
        }
    }
}